<?php 
$orgAccount = $this->Session->read('org_account');
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <?php echo $this->Html->charset(); ?>
        <title><?php echo $title_for_layout; ?></title>
        <?php
        echo $this->Html->meta('icon');
        echo $this->fetch('meta');

        echo $this->Html->css('bootstrap.min.css');
        echo $this->Html->css('bootstrap-responsive.min.css');
        echo $this->Html->css('layouts/admin.css', null, array('inline' => false));
        echo $this->Html->css('aristo/jquery-ui');
        echo $this->Html->css('jquery.pnotify/jquery.pnotify.default');
        echo $this->Html->css('jquery.contextmenu/jquery.contextMenu');
        echo $this->Html->css('jquery.nanoscroller/jquery.nanoscroller');
        echo $this->fetch('css');

        echo $this->Html->script('jquery-1.7.1.min.js');
        echo $this->Html->script('jquery-ui.js');
        echo $this->Html->script('bootstrap.min.js');
        echo $this->Html->script('core/mvc.js');
        echo $this->Html->script('core/app.js');
        echo $this->Html->script('plugins/jquery.pnotify/jquery.pnotify.min');
        echo $this->Html->script('plugins/jquery.contextmenu/jquery.contextMenu');
        echo $this->Html->script('plugins/jquery.nanoscroller/jquery.nanoscroller.min');
        ?>
    </head>
    <body>

        <div class="navbar navbar-fixed-top navbar-inverse">
            <div class="navbar-inner">
                <div class="container-fluid">
                    <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>

                    <a class="brand" href="<?php echo $this->Html->url(array('controller' => 'organisation', 'action' => 'index')); ?>">
                        <?php echo $this->Html->image('core/memberz-mini.png'); ?>
                    </a>

                    <div class="nav-collapse">
                        <ul class="nav">
                            <li class="<?php echo $this->params['controller'] == 'organisation' ? 'active' : ''; ?>"><a href="<?php echo $this->Html->url(array('controller' => 'organisation', 'action' => 'index')); ?>">Dashboard</a></li>
                            <li class="<?php echo $this->params['controller'] == 'members' ? 'active' : ''; ?>"><a href="<?php echo $this->Html->url(array('controller' => 'members', 'action' => 'index')); ?>">Members</a></li>
                            <!--<li><a href="<?php echo $this->Html->url(array('controller' => 'contributions')); ?>">Contributions</a></li>
                            <li><a href="<?php echo $this->Html->url(array('controller' => 'pledges')); ?>">Pledges</a></li>-->
                        </ul>

                        <ul class="nav pull-right">
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <?php echo $orgAccount['Organisation']['name']; ?> <b class="caret"></b>
                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="<?php echo $this->Html->url(array('controller' => 'organisation', 'action' => 'edit')); ?>"><i class="icon icon-edit"></i> Edit Organization</a>
                                    </li>
                                    <li>
                                        <a href="#"><i class="icon icon-pencil"></i> Change Subscription</a>
                                    </li>
                                    <li class="divider"></li>
                                    <li>
                                        <a href="#"><i class="icon icon-envelope"></i> Feedback / Support</a>
                                    </li>
                                </ul>
                            </li>
                            <li class="divider-vertical"></li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <?php echo $orgAccount['OrganisationAccount']['first_name']; ?> 
                                    <b class="caret"></b>
                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="#"><i class="icon icon-pencil"></i> Account Info</a>
                                    </li>
                                    <li class="divider"></li>
                                    <li>
                                        <a href="<?php echo $this->Html->url(array('controller' => 'organisation', 'action' => 'logout')); ?>"><i class="icon icon-off"></i> Logout</a>
                                    </li>
                                    <!--<li>
                                        <a href="#">Something else here</a>
                                    </li>
                                    
                                    <li>
                                        <a href="#">Separated link</a>
                                    </li>-->
                                </ul>
                            </li>
                        </ul>
                    </div>


                    <?php
                    if( false ) {
                        //echo $this->element('organisation/logged_in_elements');
                    } else {
                        //echo $this->element('organisation/login_elements');
                    }
                    ?>
                </div>
            </div>
        </div>


        <div class="container-fluid app_main" id="container">
            <?php echo $this->fetch('content'); ?>
        </div>
        
        <div>
            <div id="app_dialog"></div>
        </div>

        <?php echo $this->fetch('script'); ?>
    </body>
</html>
